import request from "@/utils/request"
//订单
const createOrder = (data) => {
    return request({
        url: "/api/order/create",
        method: "post",
        data
    })
}
//根据id查询订单
const findOrderById = (id) => {
    return request({
        url: `/api/order/find/${id}`,
        method: "get"
    })
}
//根据用户id查询订单
const findOrderByUserId = (id) => {
    return request({
        url: `/api/order/findByUserId/${id}`,
        method: "get"
    })
}
//查询所有订单
const findAllOrder = () => {
    return request({
        url: "/api/order/findAll",
        method: "get"
    })
}
//更新订单状态
const updateOrderStatus = (id, data) => {
    return request({
        url: `/api/order/update/${id}`,
        method: "put",
        data
    })
}
export { createOrder,findOrderById,findOrderByUserId,findAllOrder,updateOrderStatus }
